import api from "@/api";
export const service = process.env.VUE_APP_API_BASE_URL;
export const path = {
  loopImage: service + "/image/loopImage", //上传轮播图
  firstAd: service + "/image/firstAd", //上传一号广告位
  floatAd: service + "/image/floatAd", //上传悬浮广告位
  common2m: service + "/image/common2m", //上传图片（不超过2M），店铺logo
  common5m: service + "/image/common5m", //上传图片（不超过5M）
  shopLoopImage: service + "/image/shopLoopImage", //上传店铺首页轮播图
  companyStyle: service + "/image/companyStyle", //上传企业风采
  certificate: service + "/image/certificate", //上传资质证书
  filecommon5m: service + "/file/common5m", //上传文件（不限文件类型，不超过5M）订单支付凭证
  filecommon10m: service + "/doc/common10m", //上传文档（不超过10M）
  common2ms: service + "/image/common2ms" //上传图片（不超过2M，支持多张)
};
/**
 * 上传店铺loho
 * @param parameter {*}
 */
export function shoplogoImage(data) {
  return api.axios({
    url: path.common2m,
    method: "post",
    data: data
  });
}
/**
 * 上传店铺首页轮播图
 * @param parameter {*}
 */
export function shopLoopImage(data) {
  return api.axios({
    url: path.shopLoopImage,
    method: "post",
    data: data
  });
}
/**
 * 上传企业风采
 * @param parameter {*}
 */
export function companyStyle(data) {
  return api.axios({
    headers: {
      "Content-Type": "multipart/form-data"
    },
    url: path.companyStyle,
    method: "post",
    data: data
  });
}
/**
 * 上传资质证书
 * @param parameter {*}
 */
export function certificate(data) {
  return api.axios({
    headers: {
      "Content-Type": "multipart/form-data"
    },
    url: path.certificate,
    method: "post",
    data: data
  });
}
// 行政区域-根据父ID查询地区集合
export function getAreas(pid) {
  return api.axios({
    url: process.env.VUE_APP_API_BASE_URL + "/divisions",
    method: "get",
    params: {
      pageNo: 1,
      pageSize: 1000,
      parentId: pid
    }
  });
}
